<?php

namespace app\api\validate;

use think\Validate;

class FamilyValidate extends Validate{

    protected $rule = [
        'name'      => 'require',
        'f_id'      => 'require',
        'type'      => 'require|in:1,2,3',
        'seniority' => 'require',
        'status'    => 'require|in:0,1',
        'start_time'=> 'require|dateFormat:Y-m-d',
        'end_time'  => 'dateFormat:Y-m-d',
    ];

    protected $message = [
        'type.in'   => '请选择正确的关系',
        'f_id'      => '参数错误',
    ];

    protected $field = [
        'name'      => '名称',
        'type'      => '关系',
        'seniority' => '辈分',
        'status'    => '状态',
        'start_time'=> '出生日期',
        'end_time'  => '去世日期',
    ];
}